package com.ruoyi.GoodsAttach.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.GoodsAttach.mapper.GoodsAttachMapper;
import com.ruoyi.GoodsAttach.domain.GoodsAttach;
import com.ruoyi.GoodsAttach.service.IGoodsAttachService;
import com.ruoyi.common.core.text.Convert;

/**
 * 商品图片 服务层实现
 * 
 * @author ruoyi
 * @date 2019-07-19
 */
@Service
public class GoodsAttachServiceImpl implements IGoodsAttachService 
{
	@Autowired
	private GoodsAttachMapper goodsAttachMapper;

	/**
     * 查询商品图片信息
     * 
     * @param key 商品图片ID
     * @return 商品图片信息
     */
    @Override
	public GoodsAttach selectGoodsAttachById(Integer key)
	{
	    return goodsAttachMapper.selectGoodsAttachById(key);
	}
	
	/**
     * 查询商品图片列表
     * 
     * @param goodsAttach 商品图片信息
     * @return 商品图片集合
     */
	@Override
	public List<GoodsAttach> selectGoodsAttachList(GoodsAttach goodsAttach)
	{
	    return goodsAttachMapper.selectGoodsAttachList(goodsAttach);
	}
	
    /**
     * 新增商品图片
     * 
     * @param goodsAttach 商品图片信息
     * @return 结果
     */
	@Override
	public int insertGoodsAttach(GoodsAttach goodsAttach)
	{
	    return goodsAttachMapper.insertGoodsAttach(goodsAttach);
	}
	
	/**
     * 修改商品图片
     * 
     * @param goodsAttach 商品图片信息
     * @return 结果
     */
	@Override
	public int updateGoodsAttach(GoodsAttach goodsAttach)
	{
	    return goodsAttachMapper.updateGoodsAttach(goodsAttach);
	}

	/**
     * 删除商品图片对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteGoodsAttachByIds(String ids)
	{
		return goodsAttachMapper.deleteGoodsAttachByIds(Convert.toStrArray(ids));
	}
	
}
